﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _13.Dictionary
{
    class Dictionary
    {
        static void Main(string[] args)
        {
            string sampleDictionary = ".NET - platform for applications from Microsoft\nCLR - managed execution environment for .NET\nnamespace - hierarchical organization of classes";
            string[] categories = sampleDictionary.Split(new char[]{'\n','-'});
            Console.WriteLine("Enter a word:");
            string word = Console.ReadLine();
            bool isInDictionary = false;
            for (int i = 0; i < categories.Length; i++)
            {
                int result = string.Compare(word, categories[i].Trim(), true);
                if (result==0)
                {
                    Console.WriteLine(categories[i + 1]);
                    isInDictionary = true;
                }
            }
            if (isInDictionary==false)
            {
                Console.WriteLine("No such word in the dictionary");
            }
        }
    }
}
